package com.qingzhuge.member.service.impl;

import com.qingzhuge.common.jwt.DigestUtil;
import com.qingzhuge.core.auth.IAuthPassword;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.stereotype.Service;

/**
 * @author : zero.xiao
 * @description :
 * @date : 2018/9/26 0026 下午 16:07
 * @modified :
 * @since :
 */
@Service("authPasswordImpl")
public class AuthPasswordImpl implements IAuthPassword {
    @Override
    public String createPwd(String password, String salt) {
        return DigestUtil.sha256Digest(password + salt);
    }

    @Override
    public String getSalt() {
        return RandomStringUtils.randomAlphanumeric(16);
    }

}
